package com.dd.cloud.user.entity.file;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dd.cloud.common.annotate.FileSuffix;
import com.dd.cloud.common.constants.RegularConstants;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * app版本管理表
 *
 * @author zk
 */
@Data
@EqualsAndHashCode
@Accessors(chain = true)
@Table(comment = "app版本管理表")
public class AppVersion implements Serializable {

    private static final long serialVersionUID = 1231241232L;

    @TableId(value = "id", type = IdType.AUTO)
    @Column(isKey = true, isAutoIncrement = true)
    private Integer id;

    /**
     * appId
     */
    @Column(length = RegularConstants.Verify.MAX_ADDR, comment = "appId")
    private String appId;

    /**
     * app名称
     */
    @Column(length = RegularConstants.Verify.MAX_NAME, comment = "app名称")
    private String appName;

    /**
     * 版本号
     */
    @Column(length = RegularConstants.Verify.MAX_NAME, comment = "版本号")
    private String version;

    /**
     * app文件地址
     */
    @FileSuffix
    @Column(length = RegularConstants.Verify.MAX_URL, comment = "app文件地址")
    private String appUrl;

    /**
     * app类型 1Android 2iOS
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "app类型 1Android 2iOS")
    private Integer type;

    /**
     * 是否强制更新 1不强制 2强制
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "是否强制更新 1不强制 2强制")
    private Integer updateInstall;

    /**
     * 更新说明
     */
    @Column(length = RegularConstants.Verify.MAX_URL, comment = "更新说明")
    private String msg;

    /**
     * 下载次数
     */
    @Column(comment = "下载次数", defaultValue = "0")
    private Integer downloadNum;

    /**
     * 下载次数
     */
    @Column(comment = "自动更新次数", defaultValue = "0")
    private Integer autoUpdateNum;

    /**
     * 状态
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "状态")
    private Integer status;

    /**
     * 操作人id
     */
    @Column(comment = "操作人id")
    private Integer operId;

    /**
     * 创建时间
     */
    @Column(comment = "创建时间")
    private LocalDateTime createDate;
}
